package cn.wdm.ymcc.feign;

import cn.wdm.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeignClientFallBackFactory implements FallbackFactory<CourseFeignClient> {

    @Override
    public CourseFeignClient create(Throwable throwable) {
        return new CourseFeignClient() {
            @Override
            public JSONResult checkPlayVideoPermission(Long loginId, Long courseId) {
                return JSONResult.error("服务不可达");
            }
            @Override
            public JSONResult getCourseInfos(String courseIds) {
                return JSONResult.error("服务不可达");
            }
        };
    }
}
